package com.sena.crawler.util;
import java.lang.*;
import java.sql.*;
public class SQL {

    public static void main(String[] args)  {
        Connection conn = null;

        try
        {

            String url = "jdbc:mysql://192.168.0.118:3306/testscydxy_safe?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8";
            String sql_user = "root";
            String sql_pwd = "ROOT_1002";
            Class.forName ("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection (url,sql_user,sql_pwd);

            System.out.println ("Database connection established");
        }
        catch (Exception e)
        {
            e.printStackTrace();

        }
        finally
        {
            if (conn != null)
            {
                try
                {
                    conn.close ();
                    System.out.println ("Database connection terminated");
                }
                catch (Exception e) { /* ignore close errors */ }
            }
        }
    }

}